// 初始化词书数据
db = db.getSiblingDB('rewords');

// 删除现有数据
db.word_books.drop();

// 创建索引
db.word_books.createIndex({ "bookId": 1 }, { unique: true });
db.word_books.createIndex({ "tags.tagName": 1 });
db.word_books.createIndex({ "deleted_at": 1 });

// 插入数据
db.word_books.insertMany([
    {
        "bookId": "CET4luan_1",
        "title": "四级真题核心词（图片记忆）",
        "cover": "https://nos.netease.com/ydschool-online/1496632727200CET4luan_1.jpg",
        "bookOrigin": {
            "originUrl": "",
            "desc": "来源于",
            "originName": "有道考神团队"
        },
        "size": 788457,
        "introduce": "有道超强词频统计，考神团队诚意出品。整合历届大学英语四级真题中出现的所有单词，将3739个四级词汇通过科学的频率算法，筛选至考试必背的1162个核心词汇。搭配背单词近十年真题例句，感受最真实的考试情境，在语境中加深理解。面包君带你用最短的时间考最高的分数！适用于考生备战考试、用户高效学习。",
        "wordNum": 1162,
        "reciteUserNum": 875260,
        "offlinedata": "http://ydschool-online.nos.netease.com/1523620217431_CET4luan_1.zip",
        "version": "3",
        "tags": [
            {
                "tagName": "四级",
                "tagUrl": ""
            },
            {
                "tagName": "有道",
                "tagUrl": ""
            }
        ],
        "created_at": new Date(),
        "updated_at": new Date(),
        "deleted_at": null
    },
    {
        "bookId": "CET6luan_1",
        "title": "六级真题核心词（图片记忆）",
        "cover": "https://nos.netease.com/ydschool-online/1496655382926CET6luan_1.jpg",
        "bookOrigin": {
            "originUrl": "",
            "desc": "来源于",
            "originName": "有道考神团队"
        },
        "size": 591417,
        "introduce": "有道超强词频统计，考神团队诚意出品。整合六级大纲词汇、历届六级真题词汇，排除简单词汇，将历届六级考试中出现的单词，通过科学的频率算法，专业团队的把关，筛选至1228个必背核心词汇，帮助用户在短期内实现六级词汇量的突破。结合面包记忆法与真题例句提供的真实考试场景，面包君带你用最短的时间搞定六级！适用于考生备战考试，用户高效学习。",
        "wordNum": 1228,
        "reciteUserNum": 218418,
        "offlinedata": "http://ydschool-online.nos.netease.com/1521164660466_CET6luan_1.zip",
        "version": "3",
        "tags": [
            {
                "tagName": "六级",
                "tagUrl": ""
            },
            {
                "tagName": "有道",
                "tagUrl": ""
            }
        ],
        "created_at": new Date(),
        "updated_at": new Date(),
        "deleted_at": null
    },
    {
        "bookId": "KaoYanluan_1",
        "title": "考研必考词汇",
        "cover": "https://nos.netease.com/ydschool-online/1496632762670KaoYanluan_1.jpg",
        "bookOrigin": {
            "originUrl": "",
            "desc": "来源于",
            "originName": "有道考神团队"
        },
        "size": 771889,
        "introduce": "有道超强词频统计，考神团队诚意出品。严格按照考研英语最新大纲要求，运用科学的统计算法，考神团队深入研究历年真题及考研英语命题规律，对考研英语词汇进行深入地分析和研究，统计真实考试场景下的必背词汇，名师把关剔除简单词汇，将4533个考研词汇通过严格科学的方法筛选至1341个核心词，帮助考生省时省力完成备考！适合考研用户。",
        "wordNum": 1341,
        "reciteUserNum": 252505,
        "offlinedata": "http://ydschool-online.nos.netease.com/1521164661106_KaoYanluan_1.zip",
        "version": "3",
        "tags": [
            {
                "tagName": "考研",
                "tagUrl": ""
            },
            {
                "tagName": "有道",
                "tagUrl": ""
            }
        ],
        "created_at": new Date(),
        "updated_at": new Date(),
        "deleted_at": null
    },
    // ... 更多数据项
]);

// 验证导入
print("Total word books imported:", db.word_books.count());
